<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{$XUaCompatible}
<title></title>
<link href="{$Css}style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{$WebPublic}jquery/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="{$WebPublic}ckfinder/ckfinder.js"></script>
<script type="text/javascript" src="{$Js}common.js"></script>
<script>
	function GoBack(url){
		if( url == undefined ) url = "{$Url}index";
		window.location.href = url;
	}
	
	function keyHandler(e){
		//Ctrl+Del清除系统缓存
		if(e.ctrlKey && e.keyCode == 46){
			ClearSystemCache( "__GROUP__/public/clearCache/Action/systemcache" );
		}else if(e.shiftKey && e.keyCode == 46){  //Shift+Del一键清除全部Html静态缓存
			ClearAllHtmlCache("__GROUP__/public/clearCache/Action/allhtmlcache");
		}else if(e.ctrlKey && e.keyCode == 13){ //Ctrl+Enter提交
			if( $("#btnSubmit").length > 0 && $("#NoCtrlEnter").val() != 1 ){
				$("#myaction").val("SaveConfig"); //兼容缓存管理
				$("form:first").attr('action','{$Action}');
				$("form:first").submit();
			}
		}else if(e.ctrlKey && e.keyCode == 37){ //ctrl+<-- 搜狗不支持esc
			if( $(".GoBack").length > 0 ){  //存在返回按钮才运行
				GoBack();  //firefox 无效
			}
		}
	}
	
	//obj对象
	function toggleStatus(obj, id, tableName, status0Name, status0Value, status0Color, status1Name, status1Value, status1Color, fieldName){
		if( status0Name == undefined) status0Name ="禁用";
		if( status0Value == undefined) status0Value =0;
		if( status0Color == undefined) status0Color ="#F00";
		
		if( status1Name == undefined) status1Name ="启用";
		if( status1Value == undefined) status1Value =1;
		if( status1Color == undefined) status1Color ="#000";
		if( fieldName == undefined) fieldName ="IsEnable";
		
		if( $(obj).text() == status1Name ){
			statusValue = status0Value;  statusName = status0Name;  color = status0Color;
		}else{
			statusValue = status1Value;  statusName = status1Name;  color = status1Color;
		}
		$(obj).text( statusName );
		$(obj).css("color", color);
		var p = {id:id, FieldValue:statusValue, TableName:tableName, FieldName: fieldName};
		$.get("{$Url}toggleStatus", p, null, 'json');
	}

</script>